package com.bnzj.core.persistence.query;

/**
 * 比较操作符关键字
 * @author barry
 * @date 2019-09-30
 */
public enum CompareOperator {
    regexp, between, like, startsWith, endWith, equal, in, greaterThan, greaterThanOrEqualTo, lessThan, lessThanOrEqualTo, expression;
    public String getKeyword() {
        switch (name()) {
        case "regexp":
        case "between":
        case "like":
        case "in":
            return name();
        case "startsWith":
        case "endWith":
            return "like";
        case "equal":
            return "=";
        case "greaterThan":
            return ">";
        case "greaterThanOrEqualTo":
            return ">=";
        case "lessThan":
            return "<";
        case "lessThanOrEqualTo":
            return "<=";
        default:
            return null;
        }
    }
}
